package com.tmptSource.controller.taglib;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import com.google.gson.Gson;
import com.tmptSource.enums.*;

public class A1EnumTag {

	private Logger log = Logger.getLogger(this.getClass());


    /**
    * 数据字典中加载数据信息
    * when column.dataResource==5
    * @return
    */
    public Map<String,Object> getEnumData(){
        Map<String,Object> mapReturn = new HashMap<String, Object>();
        Gson gson = new Gson();

        //查询条件中动态数据
        Map map = null;
        <#list optionDataList as optionDataMap>
        //${optionDataMap.className}
        List<Map> list${optionDataMap.className}Copy = new ArrayList<Map>();
        list${optionDataMap.className}Copy.addAll(${optionDataMap.className}.toList());
        map = new HashMap();
        map.put("keyName","");
        map.put("valueName","全部");
        list${optionDataMap.className}Copy.add(0, map);
        mapReturn.put("${optionDataMap.className}4condition",list${optionDataMap.className}Copy);
        </#list>


        //添加编辑Dialog中，动态取数据（数据字典）
        String str = "";
        <#list optionDataList as optionDataMap>
        //${optionDataMap.className}
        str = gson.toJson(${optionDataMap.className}.toList());
        mapReturn.put("${optionDataMap.className}4addDialog",str);
        </#list>

        return mapReturn;
    }


}
